import 'package:flutter/material.dart';
import 'package:get/get.dart';

import 'package:yysk_app/routes/global_controller.dart';
import 'package:yysk_app/utils/helper.dart';
import 'package:yysk_app/utils/colors.dart';

import 'package:yysk_app/widget/card_item_widget.dart';
import 'package:yysk_app/widget/list_route_tile.dart';
import 'package:yysk_app/widget/image_asset_widget.dart';
import 'package:yysk_app/widget/custom_app_bar2.dart';
import 'package:yysk_app/pages/my_webview/my_webview_page.dart';

class AbountUsVC extends StatelessWidget {
  static String path = '/aboutUs';
  const AbountUsVC({super.key});

  @override
  Widget build(BuildContext context) {
    double top = MediaQuery.of(context).padding.top;
    final GlobalController globalController = Get.find();
    final staticInfo = globalController.staticInfo.value;
    return PopScope(
      canPop: false,
      child: Scaffold(
        bottomNavigationBar: Container(
          width: context.width,
          height: 60.px,
          padding: EdgeInsets.fromLTRB(20.px, 10.px, 10.px, 20.px),
          child: Center(
            child: Text(
              '元宇时空版权所属 ©️2025',
              style: TextStyle(color: AppColors.fontColorGrey, fontSize: 12.px),
            ),
          ),
        ),
        body: Stack(
          children: [
            SizedBox(
              width: context.width,
              child: ImageAssetWidget(
                width: 375.px,
                height: 812.px,
                imageUrl: 'static/images/bg2.png',
              ),
            ),
            Padding(
              padding: EdgeInsets.only(left: 10.px, top: top, right: 10.px),
              child: Column(
                children: [
                  CustomAppBar2(
                    title: '关于我们',
                    context: context,
                    beforBack: () {
                      Navigator.of(context).pop();
                    },
                  ),
                  Expanded(
                    child: ListView(
                      children: [
                        Container(
                          padding: EdgeInsets.fromLTRB(0, 92.px, 0, 10),
                          child: Column(
                            children: [
                              Center(
                                child: CircleAvatar(
                                  radius: 40,
                                  backgroundColor: AppColors.backgroundColor,
                                  backgroundImage: AssetImage(
                                    'static/images/about_us_logo.png',
                                  ),
                                ),
                              ),
                              hiSpace(height: 24),
                              Center(
                                child: Text(
                                  '元宇时空',
                                  style: TextStyle(
                                    color: AppColors.fontColor,
                                    fontSize: 24.px,
                                  ),
                                ),
                              ),
                              hiSpace(height: 76),
                              CardItemWidget(
                                child: Column(
                                  children: [
                                    ListRouteTile(
                                      title: '服务条款',
                                      route: '',
                                      onTap: () {
                                        Get.toNamed(
                                          '${MyWebViewPage.path}?url=${Uri.encodeComponent(staticInfo?.userAgreement ?? '')}',
                                          arguments: {
                                            'url': Uri.encodeComponent(
                                              staticInfo?.userAgreement ?? '',
                                            ),
                                          },
                                        );
                                      },
                                    ),
                                    Divider(
                                      color: AppColors.backgroundColorGrey,
                                    ),
                                    ListRouteTile(
                                      title: '隐私政策',
                                      route: '',
                                      onTap: () {
                                        Get.toNamed(
                                          '${MyWebViewPage.path}?url=${Uri.encodeComponent(staticInfo?.privacyPolicy ?? '')}',
                                          arguments: {
                                            'url': Uri.encodeComponent(
                                              staticInfo?.privacyPolicy ?? '',
                                            ),
                                          },
                                        );
                                      },
                                    ),
                                    Divider(
                                      color: AppColors.backgroundColorGrey,
                                    ),
                                    ListRouteTile(
                                      title: '平台首发数字藏品免责声明',
                                      route: '',
                                      onTap: () {
                                        Get.toNamed(
                                          '${MyWebViewPage.path}?url=${Uri.encodeComponent(staticInfo?.disclaimer ?? '')}',
                                          arguments: {
                                            'url': Uri.encodeComponent(
                                              staticInfo?.disclaimer ?? '',
                                            ),
                                          },
                                        );
                                      },
                                    ),
                                  ],
                                ),
                              ),
                            ],
                          ),
                        ),
                      ],
                    ),
                  ),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}
